import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './assets/style/reset.css'
var app=createApp(App);
// import {ElMenu,ElSubMenu,ElMenuItem,ElIcon,ElMenuItemGroup, ElMessage,ElButton,ElSwitch ,ElDatePicker,ElRadio,ElRadioGroup,ElCheckbox,ElCheckboxGroup,ElTimePicker,ElTable,ElTableColumn,ElInput,ElForm,ElFormItem,ElSelect,ElOption,ElCol,ElRow} from 'element-plus';
// 全局插件的挂载
// 全局属性的设置
app.use(ElementPlus)
import {ElMessage} from 'element-plus'
app.config.globalProperties={
  appName:"天猫",
  httpURL:"http://localhost:8080",
  $message:ElMessage
}
router.beforeEach((to,from,next)=>{
  if(to.name=="login"){
    store.commit("changeNavFlag",false)
  }else{
    store.commit("changeNavFlag",true)
  }
  if(to.name=="admin"){
    store.commit("changeBreadList",[{title:"人员管理",path:"/admin"},{title:"管理员",path:"/admin"}])
  }else if(to.name=="student"){
    store.commit("changeBreadList",[{title:"人员管理",path:"/admin"},{title:"学员管理",path:"/admin"}])
  }else if(to.name=="video"){
      store.commit("changeBreadList",[{title:"课程管理",path:"/video"},{title:"视频管理",path:"/video"}])
  }else if(to.name=="courselist"){
    store.commit("changeBreadList",[{title:"课程管理",path:"/courselist"},{title:"课程列表",path:"/courselist"}])
  }else if(to.name=="addcourse"){
    store.commit("changeBreadList",[{title:"课程管理",path:"/courselist"},{title:"课程添加",path:"/addcourse"}])
  }else{
    store.commit("changeBreadList",[])
  }
  next();
})
// app.use(ElButton).use(ElMenuItemGroup)
// app.use(ElTable).use(ElMenu).use(ElSubMenu).use(ElMenuItem).use(ElIcon)
// app.use(ElTableColumn).use(ElSwitch).use(ElDatePicker)
// app.use(ElRadio).use(ElRadioGroup).use(ElCheckbox).use(ElCheckboxGroup).use(ElTimePicker)
// app.use(ElForm).use(ElFormItem).use(ElInput).use(ElSelect).use(ElOption).use(ElCol).use(ElRow)
app.use(store).use(router).mount('#app')
